-- CALC_MARKET_BONUS_VALUE

------------------------------
-- 计算奖励价值
return function(bonusList, goodsId)
    local value = 0;
    if goodsId == 5006 then
        -- 首冲奖励
        value = 200;
    elseif goodsId == 5001 then
        -- 炼金招牌
        value = 500;
    else
        local classId;
        local num;
        local singleValue;
        for _, bonus in pairs(bonusList) do
            classId = bonus[2];
            num = bonus[3];
            if classId == "gem" then
                singleValue = 1;
            elseif classId == "money" then
                singleValue = 0.000125;
            elseif classId == "exp" then
                singleValue = 0.0125;
            elseif bonus[1] == 8 then
                singleValue = 300;
            else
                local cost = ItemM.query(classId, "sell_price")[1];
                if cost[2] == "gem" then
                    singleValue = cost[3];
                elseif cost[2] == "money" then
                    singleValue = cost[3] * 0.000125;
                else
                    singleValue = 0;
                end
            end

            value = value + singleValue * num;
        end

        local limitGiftInfo = GiftM.getLimitTimeGiftInfo();
        local giftInfo = limitGiftInfo["gift_info"];
        local requireGoodId = giftInfo["good_id"];
        local baseValue = MarketM.query(requireGoodId, "bonus");
        value = math.modf(value * 100 / baseValue[1][3]);
    end
    return value;
end
